#include "bzbutil/platform.h"

#if defined(WINDOWS)

#define WINDOWS_LEAN_AND_MEAN 1
#include <windows.h>

#elif defined(LINUX)

#include <unistd.h>

#endif

void bzbutil::throw_sys_error() {

#ifdef WINDOWS

	DWORD err = GetLastError();

#elif defined(LINUX)

	int err = errno;

#endif

	throw std::system_error(std::error_code(err,
		std::system_category()), "System error");

}


void bzbutil::throw_sys_error(int err) {

	throw std::system_error(std::error_code(err,
		std::system_category()), "System error");

}
